package javaDemo09.图形化awt;

import java.awt.*;
public class Calculator {
    public static void main(String[] args) {
        Frame f = new Frame("计算器");

        Panel p = new Panel();
        p.add(new TextField(30));
        f.add(p,BorderLayout.NORTH);
        Panel p1 = new Panel();
        p1.setLayout(new GridLayout(3,5,4,4));
        for (int i = 0; i <= 9; i++) {
            p1.add(new Button(i+""));
        }
        p1.add(new Button("+"));
        p1.add(new Button("-"));
        p1.add(new Button("*"));
        p1.add(new Button("/"));
        p1.add(new Button("."));
        f.add(p1);
        f.pack();

        f.setVisible(true);

    }
}
